package com.wo.cloud.auth.service.impl;

import org.springframework.security.oauth2.provider.ClientDetails;
import org.springframework.security.oauth2.provider.ClientRegistrationException;
import org.springframework.security.oauth2.provider.client.JdbcClientDetailsService;
import org.springframework.stereotype.Service;

import javax.sql.DataSource;

/**
 * @author liry
 * @version 1.0
 * @date Created on 2021/4/27 9:56
 * Description: A service impl that provides the details about an OAuth2 client
 */

@Service
public class ClientDetailsServiceImpl extends JdbcClientDetailsService {


    // 初始化需要 DataSource 对象
    public ClientDetailsServiceImpl(DataSource dataSource) {
        super(dataSource);
    }

    @Override
    public ClientDetails loadClientByClientId(String clientId) throws ClientRegistrationException {
        return super.loadClientByClientId(clientId);
    }
}
